package com.huike.controller.business;
import com.huike.dto.BusinessPageQueryDTO;
import com.huike.result.PageResult;
import com.huike.result.Result;
import com.huike.service.business.BusinessService;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/business")
@Slf4j
public class BusinessController {

    @Autowired
    private BusinessService businessService;


    /**
     * 分页查询商机管理
     *
     * @param
     * @return
     */
    @GetMapping("/list")
    public Result<PageResult> page(BusinessPageQueryDTO businessPageQueryDTO) {
        PageResult pageResult  = businessService.pageQuery(businessPageQueryDTO);
        return Result.success(pageResult);
    }

    //    @PostMapping()
//    private Result add(@RequestBody Business business) {
//        businessService.insertTbBusiness(business);
//        return Result.success();
//    }

    @GetMapping("/pool")
    public Result<PageResult> pool(BusinessPageQueryDTO businessPageQueryDTO) {
        PageResult pageResult = businessService.selectTbBusinessPool(businessPageQueryDTO);
        return Result.success(pageResult);
    }
}
